<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="org.apache.shiro.web.filter.authc.FormAuthenticationFilter"%>
<%@ page import="org.apache.shiro.authc.LockedAccountException "%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<c:set var="ctx" value="${pageContext['request'].contextPath}/"/>
<!DOCTYPE html >
<html>
<head>
<title>登录</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <!-- Bootstrap core CSS -->
    <link href="${ctx }common/system/css/bootstrap.min.css" rel="stylesheet">
    <link href="${ctx }common/system/css/bootstrap-reset.css" rel="stylesheet">
    <!--external css-->
    <link href="${ctx }common/system/assets/font-awesome/css/font-awesome.css" rel="stylesheet" />
    <!-- Custom styles for this template -->
    <link href="${ctx }common/system/css/style.css" rel="stylesheet">
    <link href="${ctx }common/system/css/style-responsive.css" rel="stylesheet" />
    <!-- js placed at the end of the document so the pages load faster -->
    <script src="${ctx }common/system/js/jquery.js"></script>
    <script src="${ctx }common/system/js/bootstrap.min.js"></script>
    
<script type="text/javascript">
function formsubmit(){
	var psd1 = $("#username").val();
	if(psd1 == "" || psd1 == undefined){
		document.getElementById("msg").innerHTML = "请输入员工号";
		return false;
	}
	
	var psd = $("#password").val();
	if(psd == "" || psd == undefined){
		document.getElementById("msg").innerHTML = "请输入密码";
		return false;
	}
	
	var f = document.getElementById("loginForm");
	f.submit();
	return ;
}

function enderForformsubmit(event){
	if(event.keyCode == 13 ){
		formsubmit();
	}
}
</script>
</head>
<body class="login-body">

    <div class="container">

      <form class="form-signin"  id="loginForm" action="${ctx }login.do" method="post" >
        <h2 class="form-signin-heading">sign in now</h2>
        <div style="text-align: center;color:#e56b60;">
        	<%
			String error = (String) request.getAttribute(FormAuthenticationFilter.DEFAULT_ERROR_KEY_ATTRIBUTE_NAME);
			if(error != null){
					out.print("登录失败，请重试.");
			}
			%>
        </div>
        <div class="login-wrap">
	        	<input type="text" class="form-control" name="username" id="username" placeholder="员工号" autofocus >
			    <input type="password" class="form-control" name="password" id="password" onkeydown="enderForformsubmit(event);" placeholder="密码" >
	            
	            <label class="checkbox">
	            </label>
	            <button class="btn btn-lg btn-login btn-block" type="button" onclick="formsubmit();">登录</button>
        </div>


      </form>

    </div>



    





























</body>
</html>